package com.alpha.eceasy.mall.api.vo;

import com.alpha.eceasy.mall.api.entity.MallCommodityCategory;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MallCommodityCategoryVO extends MallCommodityCategory {
    private List<MallCommodityCategory> children;
    private String parentName;

    public MallCommodityCategoryVO(MallCommodityCategory category) {
        BeanUtils.copyProperties(category, this);
    }
}

